<template>
  <div>
    <div class="table">
      <a-table :pagination="false" rowKey="id" :columns="homeMemberExperienceColumns" :data-source="homeMemberExperienceDataCpt">
        <template slot="contactType" slot-scope="text, record">
          <span v-if="text == 'Family'">{{record.relation | relationFilter}}</span>
        </template>
      </a-table>
    </div>
  </div>
</template>

<script>
import datas from '@/utils/data'

export default {
  name: "tabs6",
  props: {
    familyMemberList: Array
  },
  computed: {
    homeMemberExperienceDataCpt () {
      return this.familyMemberList.filter(item => item.contactType == 'Family')
    }
  },
  data () {
    return {
      homeMemberExperienceColumns: datas.homeMemberExperienceColumns,
      homeMemberExperienceData: this.familyMemberList,
    }
  },
  filters: {
    relationFilter (code) {
      switch (Number(code)) {
        // case 1:
        //   return '朋友'
        case 2:
          return '父母'
        case 3:
          return '子女'
        case 4:
          return '姊妹'
        case 5:
          return '兄妹'
      }
      // switch (code) {
      //   case 'Family':
      //     return '家庭成员'
      //   case 'Contact':
      //     return '紧急联系人'
      //   case 'GEN_Contact':
      //     return '普通联系人'
      //   default:
      //     return '-'
      // }
    }
  }
};
</script>

<style scoped lang="less">
</style>